<div class="posts">
	<a class="back-forum" href="/org/view/<?php echo $orgname ?>/forum">&lt;&lt;Back to Forum Index</a>
	<a class="back-thread" href="/org/view/<?php echo $orgname ?>/forum/view/<?php echo $forum; ?>">&lt;Back to Thread Index</a>
	<h2 class="heading"><?php View::show($posts[0]['thtitle']) ?></h2>
<?php if( count($posts) === 0 ): ?>
	No posts yet.
<?php endif; ?>	
<?php foreach($posts as $row):?>
	<div class="post">
<?php 	if( $isAdmin ): ?>
		<div class="delete">(<a href="/org/view/<?php echo $orgname ?>/delete-post/<?php echo $row['post_id'] ?>">Delete</a>)</div>
		<!--<div class="edit">(<a href="/org/view/<?php echo $orgname ?>/edit-post/<?php echo $row['post_id'] ?>">Edit</a>)</div>-->
<?php 	endif; ?>	
		<div style="text-align: right;">
			<div class="date"><span class="label">Posted: </span><?php View::show(date('l, M j Y, G:i:s A', strtotime($row['pdate']) + 8*3600)) ?></div>
		</div>	
		<div class="message">
		<?php View::show( str_ireplace( array_map('rtrim', file(APP_PATH. '/config/filter.txt') ), '(removed by admin)', $row['message'] ) )?>
		</div>
		<div class="author">
			-<?php View::show( ucwords( strtolower( $row['firstname']) ) ) ?> <?php View::show( ucwords( strtolower( $row['lastname'])))?>
		</div>

	</div>
	<?php endforeach ; ?>

			
	<form action="/org/view/<?php echo $orgname ?>/post" method="post">
		<label>Post:</label>
		<textarea name="message" style=""></textarea>
		<div class="buttons">
			<input type="submit" value="Submit" />
			<input type="reset" value="Clear" />
			<input type="hidden" name="threadId" value="<?php View::show($posts[0]['thread_id'])?>">
		</div>
	</form>
</div>